<template>
  <div class="main">
    <h4>每日一句</h4>
    <el-card class="box-card" v-for="(item, index) in onewordlist" :key="index">
      <div slot="header" class="clearfix">
        <span>{{ item.author }}</span>
      </div>
      <div>{{ item.content }}</div>
      <span class="oneword">{{ item.dpushtime | dateFormat}}</span>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      onewordlist: {},
    };
  },
  mounted() {
    this.getonewordlist();
  },
  methods: {
    getonewordlist() {
      this.$http
        .get(`user/oneword`)
        .then((res) => {
          this.onewordlist = res.body.data;
        });
    },
  },
};
</script>

<style>
.main {
  margin: 0 auto;
  width: 80%;
}
.box-card {
  margin-top: 20px;
}
.oneword {
  margin-top: 20px;
  height: 30px;
  color: #409eff;
  float: right;
}
</style>